﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SSMS_Scripter
{

    /// <summary>
    /// Dialog box listing options for processing dimensions
    /// </summary>
    public partial class ProcessDims : Form
    {
        // Link back to original menu item
        MenuItem parent;

        public ProcessDims()
        {
            InitializeComponent();
        }
   
        public ProcessDims(MenuItem mi, object sender)
            : this()
        {
            parent = mi;
            plProcess.LoadControl(mi.GetDims(sender), true, mi);
        }

        /// <summary>
        /// Create process script
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnProcess_Click(object sender, EventArgs e)
        {
            string result = plProcess.GetQuery();
            parent.CreateProcessTask(result);
            this.Close();
        }
    }
}
